package org.blogwu.learn.multithread.chapter3.demo23;

public class TestUnsafe {
//    static  Unsafe unsafe = Unsafe.getUnsafe();
//
//    static long stateOffset ;
//
//    private volatile long state = 0;
//
//    static {
//        try {
//            stateOffset = unsafe.objectFieldOffset( TestUnsafe.class.getDeclaredField("state"));
//        } catch (NoSuchFieldException e) {
//            e.printStackTrace();
//        }
//    }
//


    public static void main(String[] args) {
//        TestUnsafe testUnsafe = new TestUnsafe();
//        Boolean success = unsafe.compareAndSwapInt(testUnsafe, stateOffset, 0 ,1);
//        System.out.println(success);
        ClassLoader classLoader = TestUnsafe.class.getClassLoader().getParent();
        System.out.println(classLoader);
    }
}
